package cn.matezk.cloud.model;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@Data
public class PaymentOrder {
    public static final String TYPE_NF = "XF";
    public static final String TYPE_CZ = "CZ";

    public static final String STATE_SUCCESS = "SUCCESS";

    public static String createLockKey(String orderId) {
        return "lock.order.".concat(orderId);
    }

    private String orderId;
    private String appId;
    private String orderNo;
    private String payer;
    // 金额(分)
    private Integer amount;
    // 充值类型 NF: 年费 YE: 余额
    private String chargeType;
    // 设备数
    private Integer deviceTotal;
    // 备注
    private String remark;
    private String state;
    private String stateDesc;
    private String bankType;
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone="GMT+8")
    private Date orderTime;
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN, timezone="GMT+8")
    private Date successTime;
}
